package mtn.lgdx.GPS.wxapi;
import android.app.*;
import com.tencent.mm.sdk.openapi.*;
import com.tencent.mm.sdk.modelbase.*;
import android.widget.*;
import android.os.*;
import mtn.lgdx.GPS.*;

public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
	private IWXAPI api;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		api = WXAPIFactory.createWXAPI(this, getResources().getString(R.string.wxID), false);
		api.handleIntent(getIntent(), this);
		super.onCreate(savedInstanceState);
	}
	@Override
	public void onReq(BaseReq p1) {
		// TODO: Implement this method
	}

	@Override
	public void onResp(BaseResp resp) {
		// TODO: Implement this method
		String result = "未知错误";
		switch (resp.errCode) {
			case BaseResp.ErrCode.ERR_OK:
				result = "分享成功";
				break;
			case BaseResp.ErrCode.ERR_AUTH_DENIED:
				result = "无权限";
				break;
			case BaseResp.ErrCode.ERR_USER_CANCEL:
				result = "已取消";
				break;
		}
		Toast.makeText(this, result, Toast.LENGTH_SHORT).show();
		this.finish();
	}

}
